<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    var a = new Date()
    setInterval(1000)
    var b = new Date() - a
    console.log(b)

</script>

</body>
</html>